from Products.Archetypes.public import process_types, listTypes
from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore import utils 
from workflows import SurveyWorkflow, SurveyQuestionWorkflow

from AccessControl import allow_module
allow_module('Products.ArchSurvey.Permissions')
allow_module('Products.ArchSurvey.utils')

from config import SKINS_DIR, GLOBALS, PROJECTNAME
from config import ADD_CONTENT_PERMISSION

# register skin directory
registerDirectory(SKINS_DIR, GLOBALS)

def initialize(context):
    from content import Survey

    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME), PROJECTNAME)

    utils.ContentInit(
        PROJECTNAME + ' Types',
        content_types      = content_types,
        permission         = ADD_CONTENT_PERMISSION,
        extra_constructors = constructors,
        fti                = ftis
        ).initialize(context)


import questions
